<?php

/**
 * @Author: DEEP-2018BRTYLP\Administrator
 * @Date:   2019-03-19 15:17:42
 * @Last Modified by:   DEEP-2018BRTYLP\Administrator
 * @Last Modified time: 2019-04-01 11:43:55
 *
 */
namespace app\api\controller;
use app\common\model\Version;
use fast\Random;
use think\Config;
use app\api\controller\Base;
use app\index\controller\Index;
/**
 * 
 */
class Member extends Base
{	
	public $WX_APPID = 'wx6f8f0af9f1aa443a';

    public $WX_APPSECRET = 'f5a3d356ced0a028c91260222500d088';
	/*
		列表
	 */ 
	public function list()
	{
		$page = input('param.page',1);
		$num = 4;
		$gender = input('param.gender');
		$map['status'] = 1;
		$map['gender'] = $gender;
		$data = db('member')->where($map)->order('id desc')->page($page,$num)->field('id,avatar,live_city,user_name,images,headimgurl,real_name,wechat_name')->select();
 		foreach ($data as $key => &$value) {
 			$value['user_name'] = subtext($value['user_name'],8);
 			if(count($value['images'])){
				$value['images'] = explode(',',$value['images']);
			}else{
				$value['images'] = [];
			}
			if(!$value['avatar']){
				if($value['images']){
					$value['avatar'] = $value['images'][0];
				}else{
					$value['avatar'] = $value['headimgurl'];
				}
			}
			if(!$value['user_name']){
				if($value['real_name']){
					$value['user_name'] = $value['real_name'];
				}else{
					$value['user_name'] = $value['wechat_name'];
				}
			}
			$value['avatar'] = "http://".$_SERVER['SERVER_NAME'].$value['avatar'];
			if($value['live_city']){
				$value['live_city'] = explode('/',$value['live_city'])[1];
			}else{
				$value['live_city'] = "未知城市";
			}
			$value['live_city'] = subtext($value['live_city'],8);
		}
		//dump($data);exit;
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}

	/*
		列表
	 */ 
	public function search_list()
	{
		$page = input('param.page',1);
		$num = 4;
		$gender = input('param.gender');
		$age = input('param.age');
		$height = input('param.height');
		$income_id = input('param.income_id');
		$education_id = input('param.education_id');
		$birth_city = input('param.birth_city');
		if($gender){
			if($gender == 1){
				$map['gender'] = 0;
			}else{
				$map['gender'] = 1;
			}
		}
		if($age!=""){
			$ages = explode('-',$age);
			$age_str = $ages[0].",".$ages[1];
			$map['age'] = array('between',$age_str);
		}
		if($height!=""){
			$heights = explode('-',$height);
			$height_str = $heights[0].",".$heights[1];
			$map['height'] = array('between',$height_str);
		}
		if($income_id!=""){
			$map['income_id'] = $income_id;
		}
		if($education_id!=""){
			$map['education_id'] = $education_id;
		}
		if($birth_city!=""){
			$birth_citys = explode('-',$birth_city);
			$map['birth_city'] = ['like','%'.$birth_city[1].'%'];
		}
		$map['status'] = 1;
		$data = db('member')->where($map)->order('id desc')->cache(true,60)->page($page,$num)->field('id,avatar,live_city,user_name')->select();
 		foreach ($data as $key => &$value) {
 			$value['user_name'] = subtext($value['user_name'],8);
			$value['avatar'] = "http://".$_SERVER['SERVER_NAME'].$value['avatar'];
			if($value['live_city']){
				$value['live_city'] = explode('/',$value['live_city'])[1];
			}else{
				$value['live_city'] = "未知城市";
			}
			$value['live_city'] = subtext($value['live_city'],8);
		}
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}

	/**
	 *  预览列表
	 */
	public function my_view(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$page = input('param.page');
		$num = 2;
		$data = db("view")->alias('v')->join('__MEMBER__ m','m.id = v.to_uid')->where(['v.form_uid'=>$uid])->page($page,$num)->field('m.id,m.avatar,m.live_city,m.user_name')->order('v.last_time desc')->select();
		foreach ($data as $key => &$value) {
			$value['avatar'] = "http://".$_SERVER['SERVER_NAME'].$value['avatar'];
			if($value['live_city']){
				$value['live_city'] = explode('/',$value['live_city'])[1];
			}else{
				$value['live_city'] = "未知城市";
			}
		}
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}
	
	/**
	 * 我的匹配
	 */
	public function my_mate(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$page = input('param.page');
		$num = 2;
		$data = db("mate")->alias('v')->join('__MEMBER__ m','m.id = v.mate_uid')->where(['v.uid'=>$uid])->page($page,$num)->field('m.id,m.avatar,m.live_city,m.user_name,m.images,m.headimgurl,m.real_name,m.wechat_name,m.age')->order('v.id desc')->select();
		foreach ($data as $key => &$value) {
			if(count($value['images'])){
				$value['images'] = explode(',',$value['images']);
			}else{
				$value['images'] = [];
			}
			if(!$value['avatar']){
				if($value['images']){
					$value['avatar'] = $value['images'][0];
				}else{
					$value['avatar'] = $value['headimgurl'];
				}
			}
			if(!$value['user_name']){
				if($value['real_name']){
					$value['user_name'] = $value['real_name'];
				}else{
					$value['user_name'] = $value['wechat_name'];
				}
			}
			if($value['live_city']){
				$value['live_city'] = explode('/',$value['live_city'])[1];
			}else{
				$value['live_city'] = "未知城市";
			}
			$value['live_city'] = subtext($value['live_city'],8);
			$value['avatar'] = "http://".$_SERVER['SERVER_NAME'].$value['avatar'];
		}
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}
	

	/**
	 * 看过我的
	 */
	public function view_my(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$page = input('param.page');
		$num = 2;
		$data = db("view")->alias('v')->join('__MEMBER__ m','m.id = v.form_uid')->where(['v.to_uid'=>$uid])->page($page,$num)->field('m.id,m.avatar,m.live_city,m.user_name')->group('form_uid')->order('last_time desc')->select();
		foreach ($data as $key => &$value) {
			$value['avatar'] = "http://".$_SERVER['SERVER_NAME'].$value['avatar'];
			if($value['live_city']){
				$value['live_city'] = explode('/',$value['live_city'])[1];
			}else{
				$value['live_city'] = "未知城市";
			}
		}
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}

	/**
	 * 送
	 */
	public function send_flower(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$to_uid = input('param.to_uid');
		$num = 5;
		$data = [
			'from_uid' => $uid,
			'to_uid' => $to_uid,
			'num' => $num,
			'create_time' => time(),
		];
		$flower_num = db('member')->where(['id'=>$uid])->value('flower_num');
		if($flower_num<$num){
			return $this->return_success('鲜花数量不足！',[],1);
		}
		$re = db('send_flower')->where(['from_uid'=>$uid,'to_uid'=>$to_uid])->find();
		if(!$re){
			db('member')->where(['id'=>$uid])->setDec('flower_num',$num);
			db('send_flower')->insert($data);
		}
		return $this->return_success('送花成功查看微信',[],1);
	}


	/**
	 * 送花页面
	 */
	public function sendflower(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$id = input('param.id');
		$is_send = db('send_flower')->where(['from_uid'=>$uid,'to_uid'=>$id])->find();
		if($is_send){
			$info = db('member')->where(['id'=>$id])->find();
			$str = "<div class='mask'><div class='mask_content'><div class='mask_close'>X</div><div class='mask_title'>TA的微信号</div><div class='mask_num'>".$info['wechat']."</div><div class='mask_copy' data-clipboard-action='copy' data-clipboard-target='.mask_num'>复制微信号</div></div></div>";
		}else{
			$flower_num = db('member')->where(['id'=>$uid])->value('flower_num');
			$open_url = "http://".$_SERVER['SERVER_NAME']."/index.php/index/index/apply";
			$pick_url = "http://".$_SERVER['SERVER_NAME']."/index.php/index/index/flower";
			$str = "<div class='rose_mask'><div class='rose_mask_content'><div class='rose_mask_close'>X</div><div class='rose_mask_title'>送TA五朵鲜花即可获取TA的微信号</div><div class='rose_mask_num'><span class='flower'><img src='http://www.taohuanyuan.club/static/images/rose3.png' alt=''></span><span class='flower_num'> X 5<span></div><div class='rose_des'><span class='rose_num'>剩余鲜花：".$flower_num."朵</span><a href=".$pick_url."><span class='get_rose'>免费获取鲜花</span></a></div><div class='rose_mask_copy' data-id=".$id.">赠送鲜花</div><div class='rose_member'><a href=".$open_url."><span class='open_member'>开通会员</span></a>   可以直接查看微信号</div></div></div>";
		}
		return $this->return_success('返回成功！',$str,1);
	}
	/*
		详情
	 */
	
	public function detail(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$id = input('param.id',1);
		$data = db('member')->where(['id'=>$id])->cache(true,60)->find();
		$data["birthday"] = get_age($data["birthday"]);
		$data["live_city"] = city($data["live_city"]);
		$data["height"] = height($data["height"]);
		$data["weight"] = weight($data["weight"]);
		$data["education_id"] = education($data["education_id"]);
		$data["income_id"] = income($data["income_id"]);
		$data["zodiac_id"] = zodiac($data["zodiac_id"]);
		$data["house_id"] = house($data["house_id"]);
		$data["marriage_id"] = marriage($data["marriage_id"]);
		$data["car_id"] = car($data["car_id"]);
		$data["tags_ids"] = get_tags($data["tags_ids"]);
		$data["gender"] = gender($data["gender"]);
		$data['images'] = explode(',',$data['images']);
		if(!$data['user_name']){
			$data['user_name'] = $data['wechat_name'];
		}
		$data['user_name'] = subtext($data['user_name'],8);
		$data['person_data'][] = $data["live_city"];
		$data['person_data'][] = $data["weight"];
		$data['person_data'][] = $data["education_id"];
		$data['person_data'][] = $data["income_id"];
		$data['person_data'][] = $data["house_id"];
		$data['person_data'][] = $data["car_id"];
		$data['person_data'][] = $data["marriage_id"];
		$mate = db('member_mate')->where(['uid'=>$id])->find();
		if($mate){
			$data['mate_data'][] = get_age1($mate["age_id"]);
			$data['mate_data'][] = get_height1($mate["height_id"]);
			$data['mate_data'][] = car($mate["car_id"]);
			$data['mate_data'][] = house($mate["house_id"]);
			$data['mate_data'][] = income($mate["income_id"]);
			$data['mate_data'][] = education($mate["education_id"]);
			$data['mate_data'][] = marriage($mate["marriage_id"]);
			if($mate['question']){
				$data['question'] = json_decode($mate["question"]);
			}else{
				$data['question']= [];
			}
		}else{
			$data['mate_data'] = [];
			$data['question']= [];
		}
		if($uid != (int)$id){
			$is_exsit = db('view')->where(['form_uid'=>$uid,'to_uid'=>$id])->find();
			if(!$is_exsit){
				$view = [
					'form_uid' => $uid,
					'to_uid' => $id,
					'last_time' => time(),
					'create_time' => time(),
				];
				db('view')->insert($view);
			}else{
				db('view')->where(['id'=>$is_exsit['id']])->update(['last_time'=>time()]);
			}
		}
		if($data){
			return $this->return_success('获取数据',$data,1);
		}else{
			return $this->return_error('暂无数据',[],0);
		}
	}


	/**
	 * 提交个人信息
	 */
	public function sub_info(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$json_str = input('param.json_str');
		$m_json_str = input('param.m_json_str');
		$images = input('param.images');
		$question = input('param.question');
		$member_data = json_decode($json_str,true);
		$m_member_data = json_decode($m_json_str,true);
		$member_data['birthday'] = substr($member_data['birthday'],0,10);
		$member_data['age'] = get_age($member_data["birthday"]);
		$member_data['birth_city'] = implode('/',explode('-',$member_data['birth_city']));
		$member_data['live_city'] = implode('/',explode('-',$member_data['live_city']));
		$member_data['last_login_time'] = time();
		$m_member_data['create_time'] = time();
		$m_member_data['question'] = $question;
		$member_data['images'] = $images;
		$member_data['status'] = 1;
		$member_data['last_login_time'] = time();
		$member_data['is_mate'] = 1;
		//dump($member_data);dump(['id'=>$uid]);exit;
		$re = db('member')->where(['id'=>$uid])->update($member_data);
		$m_re = db('member_mate')->where(['uid'=>$uid])->find();
		if($m_re){
			$m_re = db('member_mate')->where(['uid'=>$uid])->update($m_member_data);
		}else{
			$m_member_data['uid'] = $uid;
			$m_re = db('member_mate')->insert($m_member_data);

		}
		if($re){
			return $this->return_success('提交成功',[],1);
		}else{
			return $this->return_error('提交失败',[],0);
		}
	}


	/**
	 * 提交个人信息
	 */
	public function sub_info1(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$json_str = input('param.json_str');
		$m_json_str = input('param.m_json_str');
		$images = input('param.images');
		$question = input('param.question');
		$member_data = json_decode($json_str,true);
		$m_member_data = json_decode($m_json_str,true);
		$member_data['birthday'] = substr($member_data['birthday'],0,10);
		$member_data['age'] = get_age($member_data["birthday"]);
		$member_data['birth_city'] = implode('/',explode('-',$member_data['birth_city']));
		$member_data['live_city'] = implode('/',explode('-',$member_data['live_city']));
		$member_data['last_login_time'] = time();
		$m_member_data['create_time'] = time();
		$m_member_data['question'] = $question;
		$member_data['images'] = $images;
		$member_data['status'] = 1;
		$member_data['last_login_time'] = time();
		$member_data['is_mate'] = 1;
		//dump($member_data);dump(['id'=>$uid]);exit;
		$re = db('member')->where(['id'=>$uid])->update($member_data);
		$m_re = db('member_mate')->where(['uid'=>$uid])->find();
		if($m_re){
			$m_re = db('member_mate')->where(['uid'=>$uid])->update($m_member_data);
		}else{
			$m_member_data['uid'] = $uid;
			$m_re = db('member_mate')->insert($m_member_data);

		}
		if($re){
			$re = $this->send($user_info['openid']);
			return $this->return_success('提交成功',[],1);
		}else{
			return $this->return_error('提交失败',[],0);
		}
	}

	/**
	 * 获取用户信息
	 */
	public function user_info(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$member_data = db('member')->where(['id'=>$uid])->field('id,birthday,images,avatar,user_name,real_name,wechat_name,gender,wechat,birth_city,headimgurl,live_city,height,weight,education_id,income_id,zodiac_id,marriage_id,car_id,house_id,worker,real_name,id_images,id_images1,id_number,authen_status,flower_num,mobile,hide_status,tags_ids,is_mate')->find();
		if(count($member_data['images'])){
			$member_data['images'] = explode(',',$member_data['images']);
		}else{
			$member_data['images'] = [];
		}
		if(!$member_data['avatar']){
			if($member_data['images']){
				$member_data['avatar'] = $member_data['images'][0];
			}else{
				$member_data['avatar'] = $member_data['headimgurl'];
			}
		}
		if(!$member_data['user_name']){
			if($member_data['real_name']){
				$member_data['user_name'] = $member_data['real_name'];
			}else{
				$member_data['user_name'] = $member_data['wechat_name'];
			}
		}
		$member_data['birth_city'] = implode('-',explode('/',$member_data['birth_city']));
		$member_data['live_city'] = implode('-',explode('/',$member_data['live_city']));
		if($member_data['gender'] == 0){
			$member_data['gender'] = '男';
		}else{
			$member_data['gender'] = '女';
		}
		$member_data['is_pick'] = $this->is_pick($uid);
		$m_member_data = db('member_mate')->where(['uid'=>$uid])->find();
		$m_member_data['question'] = json_decode($m_member_data['question'],true);
		return $this->return_success('获取数据成功',['m_member_data'=>$m_member_data,'member_data'=>$member_data],1);
	}

	public function get_user($uid){
		$member_data = db('member')->where(['id'=>$uid])->field('birthday,images,birth_city,live_city,height,weight,education_id,income_id,zodiac_id,marriage_id,car_id,house_id,worker,real_name,id_images,id_images1,id_number,authen_status,flower_num')->find();
		$member_data['images'] = explode(',',$member_data['images']);
		$member_data['birth_city'] = implode('-',explode('/',$member_data['birth_city']));
		$member_data['live_city'] = implode('-',explode('/',$member_data['live_city']));
		return $member_data;
	}

	/**
	 * 提交认证信息
	 */
	public function authen(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$real_name = input('param.real_name');
		$id_number = input('param.id_number');
		$id_images = input('param.id_images');
		$id_images1 = input('param.id_images1');
		$data = [
			'real_name' => $real_name,
			'id_number' => $id_number,
			'id_images' => $id_images,
			'authen_status' => 1,//待认证
			'id_images1' => $id_images1,
			'last_login_time' => time(),
		];
		//dump($data);exit;
		$re = db('member')->where(['id'=>$uid])->update($data);
		if($re){
			return $this->return_success('提交成功！',[],1);
		}else{
			return $this->return_error('提交失败！',[],0);
		}
	}

	public function weixin(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$id = input('param.id');
		$info = db('member')->where(['id'=>$id])->find();
		$str = "<div class='mask'><div class='mask_content'><div class='mask_close'>X</div><div class='mask_title'>TA的微信号</div><div class='mask_num'>".$info['wechat']."</div><div class='mask_copy' data-clipboard-action='copy' data-clipboard-target='.mask_num'>复制微信号</div></div></div>";
		return $this->return_success('返回成功！',$str,1);
	}


	public function perfect(){
		$user_info = $this->user_info;
		$str = "<div class='mask'><div class='mask_content'><div class='mask_close'>X</div><div class='mask_title'>请先完善信息哦！</div><div class='mask_num'>完善信息才可以看哦</div><div class='mask_copy' data-clipboard-action='copy' data-clipboard-target='.mask_num'><a  style='color:#fff' href='/index/index/info.html'>去完善信息</a></div></div></div>";
		return $this->return_success('提交成功！',$str,$user_info['status']);
	}
	/**
	 * 摘取
	 * @return [type] [description]
	 */
	public function pick(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$week = input('param.day');
		$date = date('Y-m-d',time());
		$date = explode('-',$date);
		$data = [
			'uid' => $uid,
			'week'=> $week,
			'year' => $date[0],
			'month' => $date[1],
			'day' => $date[2],
			'createtime' => time(),
		];
		$map['uid'] = $uid;
		$map['year'] = $date[0];
		$map['month'] = $date[1];
		$map['day'] = $date[2];
		$map['week'] = $week;
		$is_pick = db('flowers')->where($map)->find();
		if($is_pick){
			return $this->return_success('今天已摘取',['is_pick'=>1],1);
		}else{
			$re = db('flowers')->insert($data);
		}
		if($re){
			db('member')->where(['id'=>$uid])->setInc('flower_num');
			$user_info = $this->get_user($uid);
			return $this->return_success('摘取成功！',['is_pick'=>1,'user_info'=>$user_info],1);
		}else{
			return $this->return_error('摘取失败',[],0);
		}
	}
	
	/**
	 * 判断是否摘取
	 */
	public function is_pick($uid){
		$date = date('Y-m-d',time());
		$date = explode('-',$date);
		$map['uid'] = $uid;
		$map['year'] = $date[0];
		$map['month'] = $date[1];
		$map['day'] = $date[2];
		$is_pick = db('flowers')->where($map)->find();
		if($is_pick){
			return 1;
		}else{
			return 0;
		}

	}

	/**
	 * 设置显示隐藏
	 */
	public function hide(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$hide_status = input('param.hide_status');
		$re = db('member')->where(['id'=>$uid])->update(['last_login_time'=>time(),'hide_status'=>$hide_status]);
		if($re){
			return $this->return_success('设置成功!',[],1);
		}else{
			return $this->return_error('设置失败!',[],0);
		}

	}

	/**
	 * 上传信息
	 */
	public function up(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$user_name = input('param.user_name');
		$wechat = input('param.wechat');
		$avatar = input('param.avatar');
		$mobile = input('param.mobile');
		$data = [
			'user_name' => $user_name,
			'wechat' => $wechat,
			'avatar' => $avatar,
			'mobile' => $mobile,
			'last_login_time' => time(),
		];
		// dump($data);exit;
		$re = db('member')->where(['id'=>$uid])->update($data);
		$user_info = $this->get_user($uid);
		if($re){
			return $this->return_success('保存成功!',$user_info,1);
		}else{
			return $this->return_error('保存失败!',[],0);
		}
	}

	/**
	 * 点赞同一个人一天一次
	 */
	
	public function support(){
		$user_info = $this->user_info;
		$uid = $user_info['id'];
		$id = input('param.id');
		$data1 = [
			'from_uid' => $uid,
			'to_uid' => $id,
			'create_time' => time(),
		];
		$data = db('support')->where(['from_uid'=>$uid,'to_uid'=>$id])->order('create_time desc')->find();
		if($data){
			if($data['create_time'] > time()-24*60*60){
				return $this->return_success('今天已赞！',[],0);
			}else{
				$re = db('support')->insert($data1);
				db('member')->where(['id'=>$id])->setInc('up_num',1);
				return $this->return_success('点赞成功!',[],1);
			}
		}else{
			$re = db('support')->insert($data1);
			db('member')->where(['id'=>$id])->setInc('up_num',1);
			return $this->return_success('点赞成功!',[],1);
		}
	}


	 public function send($openid){
        $token = $this->get_accesstoken();
        $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={$token}";
        $post_data['touser'] = $openid;
        $post_data['template_id'] = "T-iul539F8FUDiaaULKefcXNVqMWOjtn2ZqkIKIzGro";
        $post_data['data'] = array(
            "first"=>array(
              "value"=>"匹配对象通知"
            ),
            "keyword1"=>array(
              "value"=>'匹配对象'
            ),
            "keyword2"=>array(
              "value"=>'开始匹配'
            ),
            "keyword3"=>array(
              "value"=>date('Y-m-d H:i:s',time())
            ),
            "remark"=>array(
              "value"=>"系统已开始寻找属于你的那个人"
            )
        );
        //dump($url);dump($post_data);exit;
        $res = posturl($url,json_encode($post_data));
        return $res;
    }
    
    public function get_accesstoken(){
        $access_token_info = json_decode(file_get_contents('access_token.json'),true);
        $expires_time = time()+3600;
        if($access_token_info){
            if($access_token_info['expires_time']<time()){
                $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$this->WX_APPID."&secret=".$this->WX_APPSECRET;
                $geturl = geturl($url);
                file_put_contents('access_token.json', '{"access_token": "'.$geturl['access_token'].'","expires_time": '.$expires_time.'}');
                return $geturl['access_token'];
            }else{
                return $access_token_info['access_token'];
            }
        }else{
            $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$this->WX_APPID."&secret=".$this->WX_APPSECRET;
            $geturl = geturl($url);
            file_put_contents('access_token.json', '{"access_token": "'.$geturl['access_token'].'","expires_time": '.$expires_time.'}');
            return $geturl['access_token'];
        }
        
    }


}
